home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / OpenDoc / PictPart / Source ƒ / CPPictPartStubs.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-27  |  24.8 KB  |  763 lines  |  [TEXT/MPCC]

  1. /*
  2.     File:        CPPictPartStubs.cpp
  3.  
  4.     Contains:    ODPart methods unimplemented by PictPart. ODPart is purely
  5.                 abstract, so subclasses must provide implementations of all
  6.                 methods, even if they're just stubs. The stubs aren't all
  7.                 completely empty, but the non-empty ones return the appropriate
  8.                 "Duh?" response that tells the caller that the action was
  9.                 not handled.
  10.  
  11.     Written by:    PartMaker
  12.  
  13.     Change History (most recent first):
  14.  
  15.     <3>    4/14/95    JS        Updated for Developer Release 2
  16.     <2>    3/8/95    JS        Updated to b1c13/c14
  17.     <1>    2/2/95    RA        first checked in
  18.     <0>    PartMaker source by E, Soldan, T. Çelik, J. Alfke, R. Adkins, J. Schalk
  19. */
  20.  
  21. #ifndef ODDebug
  22. #define ODDebug 0
  23. #endif
  24.  
  25. #ifndef _EXCEPT_
  26. #include <Except.h>
  27. #endif
  28.  
  29. #ifndef _CPPICTPART_
  30. #include "CPPictPart.h"
  31. #endif
  32.  
  33. #ifndef SOM_ODWindow_xh
  34. #include <Window.xh>
  35. #endif
  36.  
  37. #ifndef _PLFMDEF_
  38. #include <PlfmDef.h>
  39. #endif
  40.  
  41. //----------------------------------------------------------------------------------------
  42.  
  43. #define qDebug 0
  44.  
  45. #if qDebug
  46.     #define     WeBeHere(s) DebugStr((StringPtr)s)
  47. #else
  48.     #define     WeBeHere(s)
  49. #endif
  50.  
  51.  
  52. #ifdef applec
  53. #pragma segment PictPart
  54. #endif
  55.  
  56.  
  57. //----------------------------------------------------------------------------------------
  58. // Binding protocol
  59. //----------------------------------------------------------------------------------------
  60.  
  61. void CPPictPart::ExternalizeKinds(Environment* ev, ODTypeList* kindList)
  62.  
  63. // Externalizes a representation for each 'kind' that it supports.
  64. //
  65. // The part should iterate through all the kinds in 'kindList',
  66. // and externalize a representation for each that it supports.
  67. // This call does not specify anything about the ordering of those
  68. // kinds in the contents property. Before calling this method,
  69. // you must ensure that the part supports a subset of the kinds
  70. // in 'kindList'. After executing this method successfully, the
  71. // contents property of the part has a value and representation
  72. // for each kind in kindListsupported.
  73.  
  74. {
  75.     WeBeHere("\pCPPictPart::ExternalizeKinds");
  76. ODUnused(kindList);
  77.     this->Externalize(ev);
  78. }
  79.  
  80. //----------------------------------------------------------------------------------------
  81.  
  82. void CPPictPart::ChangeKind(Environment* ev, ODType kind)
  83.  
  84. // Asks a part to change into a new kind of content,
  85. // i.e. ask an ASCII Text part to change into a Styled Text part.
  86. //
  87. // The part should begin using the given kind as its primary kind
  88. // if it is supported. The first type of the first value in the
  89. // content property of the part's storage unit should become the
  90. // given kind. Before calling this method, you must ensure that the
  91. // part supports the specified kind. After this method is executed
  92. // successfully, the part's primary kind is the one that was
  93. // specified in the parameter, and the first type of the first
  94. // value in the content property of the part's storage unit is of
  95. // the specified type. When it reads in data, the part uses this
  96. // representation.
  97.  
  98. {
  99.     WeBeHere("\pCPPictPart::ChangeKind");
  100. ODUnused(kind);
  101. }
  102.  
  103. //----------------------------------------------------------------------------------------
  104. // DragAndDrop protocol
  105. //----------------------------------------------------------------------------------------
  106.  
  107. void CPPictPart::FulfillPromise(Environment* ev, ODStorageUnitView *promiseSUView)
  108.  
  109. // Fulfills a previously made promise by providing the actual
  110. // data the promise represents.
  111. //
  112. // The promiseSUView is a view into the same storage unit value
  113. // that is created by SetPromiseValue. The information about the
  114. // promise is encoded in the promiseSUView in the Part Handler's
  115. // own internal format. The promise data is written into the
  116. // promiseSUView replacing the data stored in the part handler's
  117. // format.
  118. //
  119. // When the promise was made, a record of it was kept by this part.
  120. // The promiseSUView contains the part's information for that promise.
  121. // The part uses the data in the promiseSUView to determine which
  122. // data to move/copy. The part then writes the data into the
  123. // promiseSUView.
  124. //
  125. // The format of a promise is determined by the part. The only
  126. // restriction is that a promise must be able to be written to
  127. // a Storage Unit Value.
  128. //
  129. // The destination part does not even know that the fulfilment
  130. // of a promise is taking place.
  131.  
  132. {
  133.     WeBeHere("\pCPPictPart::FulfillPromise");
  134. ODUnused(promiseSUView);
  135. }
  136.  
  137. //----------------------------------------------------------------------------------------
  138.  
  139. void CPPictPart::DropCompleted(Environment* ev, ODPart* destPart, ODDropResult dropResult)
  140.  
  141. // Notifies the part that the drop is completed.
  142. //
  143. // Called by the dragAndDrop object.
  144. //
  145. // DropCompleted is a peculiar method. If DragAndDrop::StartDrag is
  146. // synchronous, the return code to DragAndDrop::StartDrag is the
  147. // drop result. Part::DropCompleted does not need to be called.
  148. // However, if it is required that DragAndDrop::StartDrag returns
  149. // immediately, there needs to be a way to notify the result of the
  150. // drop. Before calling this method, you must ensure that the part
  151. // previously started an asynchronous drag.
  152.  
  153. {
  154.     WeBeHere("\pCPPictPart::DropCompleted");
  155. ODUnused(destPart);
  156. ODUnused(dropResult);
  157. }
  158.  
  159.  
  160. //----------------------------------------------------------------------------------------
  161. // Embedding protocol
  162. //----------------------------------------------------------------------------------------
  163.  
  164. void CPPictPart::ContainingPartPropertiesChanged(Environment* ev, ODFrame* displayFrame,
  165.                                                 ODStorageUnit* propertyUnit)
  166.  
  167. // Used by ContainingPart to inform the contained part of
  168. // changes to the content properties of that object within
  169. // the containing part’s content model that encapsulates the
  170. // embedded frame.
  171. //
  172. // This method inspects “propertyUnit” for properties that this
  173. // part can understand. Where applicable, it incorporate those
  174. // properties into part's content data. It ignores inapplicable
  175. // properties, without signalling an error.
  176.  
  177. {
  178.     WeBeHere("\pCPPictPart::ContainingPartPropertiesChanged");
  179. ODUnused(displayFrame);
  180. ODUnused(propertyUnit);
  181. }
  182.  
  183. //----------------------------------------------------------------------------------------
  184.  
  185. ODStorageUnit* CPPictPart::GetContainingPartProperties(Environment* ev, ODFrame* displayFrame)
  186.  
  187. // Used by an embedded part to create a storage unit and write
  188. // properties that the containing part associates with the
  189. // embedded frame into it, before returning it.
  190. //
  191. // Called by an embedded part.
  192.  
  193. {
  194.     WeBeHere("\pCPPictPart::GetContainingPartProperties");
  195. ODUnused(displayFrame);
  196.     DebugStr("\pCPPictPart::GetContainingPartProperties -- shouldn't be here.");
  197.         // Note that THROW, while valid under the temporary ASLM
  198.         // implementation of OpenDoc, won't be correct when OpenDoc
  199.         // is converted to SOM.  Therefore we are using debug messages
  200.         // for these types of errors.  When SOM is available, this issue
  201.         // will be addressed correctly.
  202.     return kODNULL;
  203. }
  204.  
  205. //----------------------------------------------------------------------------------------
  206.  
  207. ODBoolean CPPictPart::RevealFrame(Environment* ev, ODFrame* embeddedFrame, ODShape* revealShape)
  208.  
  209. // Asks a part to make an embedded frame visible.
  210. //
  211. // Called by an embedded part.
  212. //
  213. // This method scrolls one of this part's display frame's to make
  214. // the embedded frame visible therein. If this part has no visible
  215. // frames, it asks a containing part to reveal one of them. If no
  216. // display frames for the part currently exist, or if this part's
  217. // containing frame can't reveal the display frame, it opens a frame
  218. // in a new window.
  219.  
  220. {
  221.     WeBeHere("\pCPPictPart::RevealFrame");
  222. ODUnused(embeddedFrame);
  223. ODUnused(revealShape);
  224.     DebugStr("\pCPPictPart::RevealFrame -- shouldn't be here.");
  225.  
  226.     return kODFalse;
  227. }
  228.  
  229. //----------------------------------------------------------------------------------------
  230.  
  231. void CPPictPart::EmbeddedFrameSpec(Environment* ev, ODFrame* embeddedFrame, ODObjectSpec* spec)
  232.  
  233. // Creates an object specifier for the embedded frame.
  234. //
  235. // If this part is itself embedded, this method asks its containing
  236. // part for the specifier for the part's display frame, then
  237. // concatenates the specifier for that embedded frame.
  238.  
  239. {
  240.     WeBeHere("\pCPPictPart::EmbeddedFrameSpec");
  241. ODUnused(embeddedFrame);
  242. ODUnused(spec);
  243.     DebugStr("\pCPPictPart::EmbeddedFrameSpec -- shouldn't be here.");
  244. }
  245.  
  246. //----------------------------------------------------------------------------------------
  247.  
  248. ODEmbeddedFramesIterator* CPPictPart::CreateEmbeddedFramesIterator(Environment* ev, ODFrame* frame)
  249.  
  250. // Creates an object that will iterate over the frames that
  251. // are embedded within a display frame of this part.
  252. //
  253. // To indicate all the display frames, use kODNull for the frame
  254. // parameter.
  255.  
  256. {
  257.     WeBeHere("\pCPPictPart::CreateEmbeddedFramesIterator");
  258. ODUnused(frame);
  259.     DebugStr("\pCPPictPart::CreateEmbeddedFramesIterator -- shouldn't be here.");
  260.     return kODNULL;
  261. }
  262.  
  263. //----------------------------------------------------------------------------------------
  264. // Frame protocol
  265. //----------------------------------------------------------------------------------------
  266.  
  267.  
  268. void CPPictPart::AttachSourceFrame(Environment* ev, ODFrame* frame, ODFrame* sourceFrame)
  269.  
  270. // Called by the object that requested creation of a frame,
  271. // immediately after the creation of the frame.
  272. //
  273. // Calling this method associates a “source frame” with a display
  274. // frame of a part. This tells the part to keep two or more of its
  275. // display frames synchronized.
  276. //
  277. // A part will receive this call just after a display frame has
  278. // been added. Attaching a source frame should cause the display
  279. // frame to look identical to it. If presentations differ, it
  280. // causes the display frame to be equivalent to it. This causes
  281. // duplication of the embedded frames, and ensures that the view
  282. // in one frame is updated when content in the other is changed.
  283. // Before calling this method, you must ensure that both frame
  284. // and sourceFrame are display frames of the part.
  285. //
  286. // The part being displayed should take whatever action necessary
  287. // to synchronize the frames. As a minimum, if the two frames are
  288. // the same kind of presentation, it should duplicate embedded
  289. // frames in one frame into the other.
  290.  
  291. {
  292.     WeBeHere("\pCPPictPart::AttachSourceFrame");
  293. ODUnused(frame);
  294. ODUnused(sourceFrame);
  295. }
  296.  
  297. //----------------------------------------------------------------------------------------
  298.  
  299. void CPPictPart::ViewTypeChanged(Environment* ev, ODFrame* frame)
  300.  
  301. // Notifies the part that the viewType of one of its
  302. // frames has been changed.
  303. //
  304. // Parts must support all standard view types.
  305. // And they are ... ???
  306.  
  307. {
  308.     WeBeHere("\pCPPictPart::ViewTypeChanged");
  309. ODUnused(frame);
  310. }
  311.  
  312. //----------------------------------------------------------------------------------------
  313.  
  314. void CPPictPart::PresentationChanged(Environment* ev, ODFrame* frame)
  315.  
  316. // Notifies the part that the presentation kind of one
  317. // of its frames has been changed.
  318. //
  319. // Called by Frame::ChangeViewType().
  320. //
  321. // The part should examine the new view type via
  322. // frame->GetViewType(). If the part does not support that kind
  323. // of view type, it should correct the frame's viewType using
  324. // frame->SetViewType(). Note that parts MUST support the
  325. // standard set of view types (se HI spec). The part should then
  326. // adjust its display in the display frame to be of the new view
  327. // type.
  328.  
  329. {
  330.     WeBeHere("\pCPPictPart::PresentationChanged");
  331. ODUnused(frame);
  332. }
  333.  
  334. //----------------------------------------------------------------------------------------
  335.  
  336. void CPPictPart::SequenceChanged(Environment* ev, ODFrame* frame)
  337.  
  338. // Informs the part that the sequencing of a group of its
  339. // display frames has been changed.
  340. //
  341. // Called by containing part.
  342. //
  343. // The containing part of frame should call this when adding a new
  344. // frame to the group or re-ordering the frames in the group. A
  345. // single frame of the group is passed as an argument to indicate
  346. // which group of which containing frame has been changed.
  347.  
  348. {
  349.     WeBeHere("\pCPPictPart::SequenceChanged");
  350. ODUnused(frame);
  351. }
  352.  
  353.  
  354.  
  355.  
  356. //----------------------------------------------------------------------------------------
  357.  
  358. ODFrame* CPPictPart::RequestEmbeddedFrame(Environment* ev, ODFrame* containingFrame,
  359.                                            ODFrame* baseFrame,
  360.                                            ODShape* frameShape,
  361.                                            ODPart* embedPart,
  362.                                            ODTypeToken viewType,
  363.                                            ODTypeToken presentation,
  364.                                            ODBoolean isOverlaid)
  365.  
  366. // Asks the part to create a new frame and embed a part in it.
  367. //
  368. // This is only requested by embedded parts which want additional
  369. // frames in which to display in the same containing part.
  370. //
  371. // If this part is a containing part, it should ask the draft to
  372. // create a new frame, and embed the frame in its content.
  373. // “baseFrame” is another display frame of the same part, already
  374. // embedded in the same containing part. The frameShape parameter
  375. // is relative to the frame coordinate system of the baseFrame.
  376. // The containing part decides if it can fulfill the requests for
  377. // frameShape. - if not, it can create the frame where it wants
  378. // and with the shape it chooses. The containing part should assign
  379. // the new frame to the same frameGroup as the baseFrame. If
  380. // isOverlaid is true, the new frame should float above the part's
  381. // content, and should not have to negotiate for space with the part.
  382. // The viewType and presentation are just passed through to
  383. // Draft::CreateFrame().
  384. //
  385. // Note that RequestEmbeddedFrame should only be called by an embedded
  386. // part on its containing part in order to get a sibling frame.  That
  387. // is why this call takes a baseFrame parameter.  The baseFrame must
  388. // already be embedded inside the part receiving the
  389. // RequestEmbeddedFrame message.
  390.  
  391. {
  392.     WeBeHere("\pCPPictPart::RequestEmbeddedFrame");
  393. ODUnused(containingFrame);
  394. ODUnused(baseFrame);
  395. ODUnused(frameShape);
  396. ODUnused(embedPart);
  397. ODUnused(viewType);
  398. ODUnused(presentation);
  399. ODUnused(isOverlaid);
  400.     DebugStr("\pCPPictPart::RequestEmbeddedFrame -- shouldn't be here.");
  401.     return kODNULL;
  402. }
  403.  
  404. //----------------------------------------------------------------------------------------
  405.  
  406. void CPPictPart::RemoveEmbeddedFrame(Environment* ev, ODFrame* embeddedFrame)
  407.  
  408. // Removes a frame used for viewing an embedded part.
  409. //
  410. // Called by an embedded part.
  411. //
  412. // It is called by an embedded part to indicate it no longer
  413. // needs the frame to display itself.
  414.  
  415. {
  416.     WeBeHere("\pCPPictPart::RemoveEmbeddedFrame");
  417. ODUnused(embeddedFrame);
  418.     DebugStr("\pCPPictPart::RemoveEmbeddedFrame -- shouldn't be here.");
  419. }
  420.  
  421. //----------------------------------------------------------------------------------------
  422.  
  423. ODShape* CPPictPart::RequestFrameShape(Environment* ev, ODFrame* embeddedFrame, ODShape* frameShape)
  424.  
  425. // Used by an embedded part to ask for a change in the
  426. // shape of its frame.
  427. //
  428. // Called by Frame::RequestFrameShape().
  429. //
  430. // This method decides what new shape to give the embedded frame,
  431. // using the requested “frameShape” as a guideline. It then
  432. // answers with what shape is actually granted as the return value.
  433. // The requestor must abide by the returned shape, though it may
  434. // make further requests for different shapes or additional frames.
  435.  
  436. {
  437.     WeBeHere("\pCPPictPart::RequestFrameShape");
  438. ODUnused(embeddedFrame);
  439. ODUnused(frameShape);
  440.     DebugStr("\pCPPictPart::RequestFrameShape -- shouldn't be here.");
  441.     return kODNULL;
  442. }
  443.  
  444. //----------------------------------------------------------------------------------------
  445.  
  446. void CPPictPart::UsedShapeChanged(Environment* ev, ODFrame* embeddedFrame)
  447.  
  448. // Informs a containing part that the used shape of one of
  449. // its embedded frames has changed.
  450. //
  451. // Called by Frame::ChangeUsedShape().
  452. //
  453. // Containing parts that have arranged their content to conform
  454. // to the used shape of an embedded frame (as in text wrapping)
  455. // will need to adjust the layout of that content for the new
  456. // used shape.
  457.  
  458. {
  459.     WeBeHere("\pCPPictPart::UsedShapeChanged");
  460. ODUnused(embeddedFrame);
  461. }
  462.  
  463. //----------------------------------------------------------------------------------------
  464.  
  465. ODShape* CPPictPart::AdjustBorderShape(Environment* ev, ODFacet* embeddedFacet, ODShape* shape)
  466.  
  467. // Adjusts the shape of the active frame border of an embedded
  468. // frame.
  469. //
  470. // Called by the arbitrator object.
  471. //
  472. // The “shape” parameter specifies the requested shape. The
  473. // return value specifies that shape as it is obscured by the
  474. // other contents of this part.
  475.  
  476. {
  477.     WeBeHere("\pCPPictPart::AdjustBorderShape");
  478. ODUnused(embeddedFacet);
  479.     return shape;
  480. }
  481.  
  482. //----------------------------------------------------------------------------------------
  483.  
  484. void CPPictPart::CanvasChanged(Environment* ev, ODFacet* facet)
  485.  
  486. // Notifies the part that one of its facets has been moved to
  487. // image on a different canvas.
  488. //
  489. // Called by the facet object.
  490. //
  491. // The part must update any internal state necessary for
  492. // compliance with this method.
  493.  
  494. {
  495.     WeBeHere("\pCPPictPart::CanvasChanged");
  496. ODUnused(facet);
  497. }
  498.  
  499. //----------------------------------------------------------------------------------------
  500.  
  501. void CPPictPart::GeometryChanged(Environment* ev, ODFacet* facet,
  502.                                                    ODBoolean clipShapeChanged,
  503.                                                    ODBoolean externalTransformChanged)
  504.  
  505. // Called by a facet of the part to inform it that the clipping
  506. // shape and/or external transform of that facet has changed.
  507. //
  508. // Called by the facet object.
  509. //
  510. // The part should use the new clip shape for display from now
  511. // on. Parts that display only in response to update events don't
  512. // need to do anything special, provided they check the clip
  513. // shape each time they draw. Parts that display asynchronously
  514. // (like clocks, movies, etc.) must notice their new clipping and
  515. // limit their display accordingly.
  516.  
  517. {
  518.     WeBeHere("\pCPPictPart::GeometryChanged");
  519. ODUnused(facet);
  520. ODUnused(clipShapeChanged);
  521. ODUnused(externalTransformChanged);
  522. }
  523.  
  524. //----------------------------------------------------------------------------------------
  525.  
  526. void CPPictPart::FacetRemoved(Environment* ev, ODFacet* facet)
  527. {
  528.     WeBeHere("\pCPPictPart::FacetRemoved");
  529. }
  530.  
  531. //----------------------------------------------------------------------------------------
  532. // Imaging protocol
  533. //----------------------------------------------------------------------------------------
  534.  
  535. void CPPictPart::CanvasUpdated(Environment* ev, ODCanvas* canvas)
  536.  
  537. // Notifies the part that a canvas that it owns has been
  538. // updated and that its contents need to be copied to its
  539. // parent canvas.
  540. //
  541. // Called by the facet object.
  542. //
  543. // The data must be copied from an off-screen canvas,
  544. // transformed, and then placed in the containing canvas.
  545.  
  546. {
  547.     WeBeHere("\pCPPictPart::CanvasUpdated");
  548. ODUnused(canvas);
  549. }
  550.  
  551. //----------------------------------------------------------------------------------------
  552.  
  553. void CPPictPart::HighlightChanged(Environment* ev, ODFacet* facet)
  554.  
  555. // Notifies the part that the highlight state of one of its
  556. // frames has been changed.
  557. //
  558. // Called by the frame object.
  559. //
  560. // It adjusts this part's presentation in the facet to its
  561. // new highlight state. New state may be found by calling
  562. // facet->GetHighlight(). It passes notification to embedded
  563. // parts.
  564.  
  565. {
  566.     WeBeHere("\pCPPictPart::HighlightChanged");
  567. ODUnused(facet);
  568. }
  569.  
  570. //----------------------------------------------------------------------------------------
  571.  
  572. ODULong CPPictPart::GetPrintResolution(Environment* ev, ODFrame* frame)
  573.  
  574. // Returns the minimum desired resolution in dots per inch
  575. // that this part requires for printing the contents of the
  576. // specified frame.
  577. //
  578. // Called by part or the application and is used in performing
  579. // printing.
  580.  
  581. {
  582.     WeBeHere("\pCPPictPart::GetPrintResolution");
  583. ODUnused(frame);
  584.     return 0;
  585. }
  586.  
  587. //----------------------------------------------------------------------------------------
  588. // From Linking protocol
  589. //----------------------------------------------------------------------------------------
  590.  
  591. void CPPictPart::EmbeddedFrameChanged(Environment* ev, ODFrame* frame, ODChangeID change)
  592.  
  593. // Notifies the containing part that the content displayed
  594. // in the argument “embedded frame” has changed.
  595. //
  596. // Called by an frame object belonging to an embedded part when
  597. // the frame object's ContentChanged method is called.
  598. //
  599. // The part should call the ContentChanged method of any of its
  600. // frames that would be interested in this information. This
  601. // method should only be called by frame objects. The part is
  602. // not responsible for passing this notification on to its
  603. // containing part. The part may ignore this notification if it
  604. // is uninterested in changes to embedded content. A part should
  605. // wait a certain length of time (a second perhaps) before
  606. // updating its display so that subsequent calls to
  607. // EmbeddedFrameChanged with the same ODChangeID don’t result
  608. // in multiple updates for the same change.After executing this
  609. // method successfully, the ContentChanged method of any of the
  610. // part's frames may have been called and the part may have
  611. // taken action to update its display.
  612.  
  613. {
  614.     WeBeHere("\pCPPictPart::EmbeddedFrameChanged");
  615. ODUnused(change);
  616. ODUnused(frame);
  617. }
  618.  
  619. //----------------------------------------------------------------------------------------
  620.  
  621. void CPPictPart::LinkStatusChanged(Environment* ev, ODFrame* frame)
  622.  
  623. // Allows the part to set the link status of any embedded frames.
  624. //
  625. // Called by a part's frame when that frame's ChangeLinkStatus
  626. // method is called.
  627. //
  628. // Frames notify their owner parts that their link status has
  629. // changed whenever ChangeLinkStatus is called. After this
  630. // method executes successfully, the part will call
  631. // ChangeLinkStatus on any embedded frames that are involved
  632. // in the link in question.
  633.  
  634. {
  635.     WeBeHere("\pCPPictPart::LinkStatusChanged");
  636. ODUnused(frame);
  637. }
  638.  
  639. //----------------------------------------------------------------------------------------
  640. // Undo protocol
  641. //----------------------------------------------------------------------------------------
  642.  
  643. void CPPictPart::UndoAction(Environment* ev, ODActionData* actionState)
  644.  
  645. // Tells the part to undo the action that is described by actionState.
  646. //
  647. // Called by the undo object.
  648.  
  649. {
  650.     WeBeHere("\pCPPictPart::UndoAction");
  651. ODUnused(actionState);
  652. }
  653.  
  654. //----------------------------------------------------------------------------------------
  655.  
  656. void CPPictPart::RedoAction(Environment* ev, ODActionData* actionState)
  657.  
  658. // Tells the part to Redo the action described by actionState.
  659. //
  660. // Called by the undo object.
  661.  
  662. {
  663.     WeBeHere("\pCPPictPart::RedoAction");
  664. ODUnused(actionState);
  665. }
  666.  
  667. //----------------------------------------------------------------------------------------
  668.  
  669. void CPPictPart::DisposeActionState(Environment* ev, ODActionData* actionState,
  670.                                    ODDoneState doneState)
  671.  
  672. // Tells the part to dispose of the action data.
  673. //
  674. // Before calling this method, you must ensure that “actionState”
  675. // is an action data block previously logged by this part. After
  676. // calling this method successfully, memory for “actionState” has
  677. // been reclaimed. It is no longer usable to perform undo operations.
  678.  
  679. {
  680.     WeBeHere("\pCPPictPart::DisposeActionState");
  681. ODUnused(actionState);
  682. ODUnused(doneState);
  683. }
  684.  
  685. //----------------------------------------------------------------------------------------
  686.  
  687. void CPPictPart::WriteActionState(Environment* ev, ODActionData* actionState,
  688.                                  ODStorageUnitView* storageUnitView)
  689.  
  690. // Writes out the actionState data onto a StorageUnitView,
  691. // and externalizes the undoAction data to the storage unit.
  692. //
  693. // Called by the undo object.
  694.  
  695. {
  696.     WeBeHere("\pCPPictPart::WriteActionState");
  697. ODUnused(actionState);
  698. ODUnused(storageUnitView);
  699. }
  700.  
  701. //----------------------------------------------------------------------------------------
  702.  
  703. ODActionData CPPictPart::ReadActionState(Environment* ev, ODStorageUnitView* storageUnitView)
  704.  
  705. // Internalizes the undoAction data from the storage unit.
  706. //
  707. // This method reads the actionState data from a view on a
  708. // StorageUnit. It then allocates the memory and passes ownership
  709. // of the storage to the caller.
  710.  
  711. {
  712.     WeBeHere("\pCPPictPart::ReadActionState");
  713. ODUnused(storageUnitView);
  714.  
  715.     ODActionData data;
  716.     data._maximum = 0;
  717.     data._length = 0;
  718.     data._buffer = kODNULL;
  719.     return data;
  720. }
  721.  
  722. //----------------------------------------------------------------------------------------
  723.  
  724. void CPPictPart::IncrementRefCount(Environment* ev)
  725. {
  726.     WeBeHere("\pCPPictPart::IncrementRefCount");
  727. }
  728.  
  729. //----------------------------------------------------------------------------------------
  730.  
  731. void CPPictPart::ReleaseExtension(Environment* ev, ODExtension* extension)
  732. {
  733.     WeBeHere("\pCPPictPart::ReleaseExtension");
  734. ODUnused(extension);
  735. }
  736.  
  737. //----------------------------------------------------------------------------------------
  738.  
  739. ODExtension* CPPictPart::GetExtension(Environment* ev, ODType extensionName)
  740. {
  741.     WeBeHere("\pCPPictPart::GetExtension");
  742. ODUnused(extensionName);
  743.  
  744.     DebugStr("\pUntil the part implements extension support, this should not get called.");
  745.  
  746.     ev->_major = kODErrUnsupportedExtension;
  747.         // If we are called with an extension type we don't support,
  748.         // we should be returning an error here.
  749.  
  750.     return kODNULL;
  751. }
  752.  
  753. //----------------------------------------------------------------------------------------
  754.  
  755. ODBoolean CPPictPart::HasExtension(Environment* ev, ODType extensionName)
  756. {
  757.     WeBeHere("\pCPPictPart::HasExtension");
  758. ODUnused(extensionName);
  759.  
  760.     return kODFalse;
  761.         // No extension until you implement one for your part.
  762. }
  763.